home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d879.lha / DiskTest / Source / dt.h < prev    next >
Text File  |  1993-04-05  |  2KB  |  74 lines

  1. /*------------------------------------*
  2.  | File: DT.h - Include file for DT.c |
  3.  *------------------------------------*/
  4.  
  5. /**
  6.  | Parameters (#define):
  7.  | - length of various buffers (all-purpose, and track/file check)
  8.  | - maximum length of file paths
  9.  | - arguments for Motor()
  10.  | - break flag bits
  11.  | - "break window" parameters
  12.  | - AppWindow ID
  13. **/
  14.  
  15. #define SLATE_DIM     128
  16. #define FILBUF_DIM    (512 * 11)
  17.  
  18. #define PATHNAME_MAX  256
  19.  
  20. #define ON            1
  21. #define OFF           0
  22.  
  23. #define BRK_DETECTED  0x1
  24. #define WARN_PRINTED  0x10
  25. #define INTERNAL_ERR  (BRK_DETECTED | WARN_PRINTED)
  26.  
  27. #define BKW_IDCMP     BUTTONIDCMP
  28.  
  29. #define AW_ID   17
  30.  
  31. /**
  32.  | A structure to store directory entries, when checking
  33.  | the integrity of a whole directory tree.
  34. **/
  35.  
  36. typedef struct sdirEntry {
  37.   struct sdirEntry *next;
  38.   char name[1];
  39. } dirEntry;
  40.  
  41. /**
  42.  | Local global variables
  43. **/
  44.  
  45. static char slate[SLATE_DIM];         /* All-purpose buffer           */
  46. static ULONG diskChangeCount;         /* Disk change count            */
  47. static int nErFil;                    /* Total number of errors       */
  48. static int nDirs;                     /* Nr. of checked directories   */
  49. static int nFiles;                    /* Nr. of checked files         */
  50. static BOOL listFileNames = TRUE;     /* "List file names" flag       */
  51. static unsigned abortDT = 0;          /* True when CTRL-C hit         */
  52. static struct DriveGeometry drGeom;   /* Floppy drive characteristics */
  53. static ULONG cylSize;                 /* Bytes per cylinder           */
  54.  
  55. /**
  56.  | Local procedures
  57. **/
  58.  
  59. static void     ActionMenu(const int code);
  60. static unsigned CheckBreak(void);
  61. static void     CheckDir(char *path, const BOOL root);
  62. static void     CheckFile(char *name);
  63. static void     DirStuff(char *name, int i);
  64. static void     DiskCheck(const int drive);
  65. static void     EndTest(void);
  66. static void     FileStuff(BPTR dirLock, char *dirName, char *filName,
  67.                           int i);
  68. static void     GetBuffer(const ULONG size);
  69. static void     Motor(const ULONG action);
  70. static void     OutLine(const BOOL last, char *fmt, ...);
  71. static void     ReadCyl(const int cyl, const int hd);
  72. static void     SeekFullRange(const SHORT howmany);
  73. static void     StartTest(int i);
  74.